@extends('layout.home.master')
@section('content')
    <div class="container mt-5">
        <div class="row">
            <div class="col-12 col-xl-3">
                @include('layout.infor.menu')
            </div>

            <div class="col-12 col-xl-9">
                <div class="card">
                    <div class="card-header">
                        消息通知
                    </div>

                    <div class="table-responsive text-center">
                        <table class="table table-sm  card-table">
                            <thead>
                            <tr>

                                <th>
                                    <a href="#" class="text-muted sort">
                                        消息内容
                                    </a>
                                </th>
                                <th>
                                    <a href="#" class="text-muted sort">
                                       时间
                                    </a>
                                </th>
                                <th>
                                    <a href="#" class="text-muted sort">
                                        状态
                                    </a>
                                </th>
                                <th>
                                    <a href="#" class="text-muted sort" >
                                        操作
                                    </a>

                                </th>
                            </tr>
                            </thead>
                            <tbody class="list">
                            @foreach(auth()->user()->notifications()->orderBy('id','desc')->get() as $notification)
                            <tr>
                                <td class="orders-order" >
                                    {{$notification['data']['user_name']}} 评论了
                                    <a class="text-muted" href="{{route('info.ReadNotify',$notification)}}"><span class="badge badge-secondary">{{$notification['data']['article_title']}}</span> </a> 文章
                                </td>
                                <td class="orders-product">
                                    {{$notification->created_at}}
                                </td>
                                <td class="orders-product">
                                    @if($notification->read_at)
                                    <span class="badge badge-primary">已读</span>
                                    @else
                                    <span class="badge badge-warning">未读</span>
                                        @endif

                                </td>
                                <td class="orders-product">
                                    <a href="#" style="color: #fff" class="badge badge-danger"></a><a href="#" style="color: red; font-size: 15px" class="fe fe-x-circle"></a>

                                </td>
                            </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection
